/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.vo;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author wyr
 */
@Entity
@Table(name = "song_albumsongs")
//@NamedQueries({@NamedQuery(name = "SongAlbumsongs.findAll", query = "SELECT s FROM SongAlbumsongs s"), @NamedQuery(name = "SongAlbumsongs.findByAlbumId", query = "SELECT s FROM SongAlbumsongs s WHERE s.songAlbumsongsPK.albumId = :albumId"), @NamedQuery(name = "SongAlbumsongs.findBySongId", query = "SELECT s FROM SongAlbumsongs s WHERE s.songAlbumsongsPK.songId = :songId"), @NamedQuery(name = "SongAlbumsongs.findByTrackId", query = "SELECT s FROM SongAlbumsongs s WHERE s.trackId = :trackId"), @NamedQuery(name = "SongAlbumsongs.findByVolumeId", query = "SELECT s FROM SongAlbumsongs s WHERE s.volumeId = :volumeId")})
public class SongAlbumsongs implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected SongAlbumsongsPK songAlbumsongsPK;
    @Column(name = "trackId")
    private Integer trackId;
    @Column(name = "volumeId")
    private Integer volumeId;

    public SongAlbumsongs() {
    }

    public SongAlbumsongs(SongAlbumsongsPK songAlbumsongsPK) {
        this.songAlbumsongsPK = songAlbumsongsPK;
    }

    public SongAlbumsongs(int albumId, int songId) {
        this.songAlbumsongsPK = new SongAlbumsongsPK(albumId, songId);
    }

    public SongAlbumsongsPK getSongAlbumsongsPK() {
        return songAlbumsongsPK;
    }

    public void setSongAlbumsongsPK(SongAlbumsongsPK songAlbumsongsPK) {
        this.songAlbumsongsPK = songAlbumsongsPK;
    }

    public Integer getTrackId() {
        return trackId;
    }

    public void setTrackId(Integer trackId) {
        this.trackId = trackId;
    }

    public Integer getVolumeId() {
        return volumeId;
    }

    public void setVolumeId(Integer volumeId) {
        this.volumeId = volumeId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (songAlbumsongsPK != null ? songAlbumsongsPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SongAlbumsongs)) {
            return false;
        }
        SongAlbumsongs other = (SongAlbumsongs) object;
        if ((this.songAlbumsongsPK == null && other.songAlbumsongsPK != null) || (this.songAlbumsongsPK != null && !this.songAlbumsongsPK.equals(other.songAlbumsongsPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.SongAlbumsongs[songAlbumsongsPK=" + songAlbumsongsPK + "]";
    }

}
